package com.qidao.userlogin.controller;

import com.qidao.commonutils.R;
import com.qidao.userlogin.entity.User;
import com.qidao.userlogin.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author testjava
 * @since 2020-10-14
 */
@RestController
@RequestMapping("/userlogin/user")
@Api(description = "登录")
public class UserController {

    @Autowired
    private UserService userService;

    @ApiOperation("登录")
    @GetMapping("login")
    public R login(User user){
        System.out.println(".........");
        List<User> list = userService.list(null);
        System.out.println(list.size());
        return R.ok().data("data",list);
    }

}

